<!--

     Licensed to the Apache Software Foundation (ASF) under one
     or more contributor license agreements.  See the NOTICE file
     distributed with this work for additional information
     regarding copyright ownership.  The ASF licenses this file
     to you under the Apache License, Version 2.0 (the
     "License"); you may not use this file except in compliance
     with the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing,
     software distributed under the License is distributed on an
     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     KIND, either express or implied.  See the License for the
     specific language governing permissions and limitations
     under the License.

-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- **************************************************************** -->
<!-- *  PLEASE KEEP COMPLICATED EXPRESSIONS OUT OF THESE TEMPLATES, * -->
<!-- *  i.e. only iterate & print data where possible. Thanks, Jez. * -->
<!-- **************************************************************** -->

<html>
<head>
    <!-- Generated by groovydoc (2.4.8) on Tue Sep 19 09:24:00 EDT 2017 -->
    <title>PipelineUtils</title>
    <meta name="date" content="2017-09-19">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="../groovy.ico" type="image/x-icon" rel="shortcut icon">
    <link href="../groovy.ico" type="image/x-icon" rel="icon">
    <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

<body class="center">
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
    parent.document.title="PipelineUtils";
}
//-->
</script>
<noscript>
    <div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
    <!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
    <!--   -->
</a>
    <ul class="navList" title="Navigation">
        <li><a href="../overview-summary.html">Overview</a></li>
        <li><a href="package-summary.html">Package</a></li>
        <li class="navBarCell1Rev">Class</li>
        <li><a href="../deprecated-list.html">Deprecated</a></li>
        <li><a href="../index-all.html">Index</a></li>
        <li><a href="../help-doc.html">Help</a></li>
    </ul>
</div>

<div class="subNav">
    <div>
        <ul class="navList">
            <li><a href="../index.html?DefaultPackage/PipelineUtils" target="_top">Frames</a></li>
            <li><a href="PipelineUtils.html" target="_top">No Frames</a></li>
        </ul>
    </div>
    <div>
        <ul class="subNavList">
            <li>Summary:&nbsp;</li>
            Nested&nbsp;&nbsp;&nbsp;Field&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="#method_summary">Method</a></li>&nbsp;&nbsp;&nbsp;
        </ul>
        <ul class="subNavList">
            <li>&nbsp;|&nbsp;Detail:&nbsp;</li>
            Field&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="#method_detail">Method</a></li>&nbsp;&nbsp;&nbsp;
        </ul>
    </div>
    <a name="skip-navbar_top">
        <!--   -->
    </a></div>
<!-- ========= END OF TOP NAVBAR ========= -->

<!-- ======== START OF CLASS DATA ======== -->
<div class="header">

    <div class="subTitle">Package: <strong>org.centos.pipeline</strong></div>

    <h2 title="[Groovy] Script PipelineUtils" class="title">[Groovy] Script PipelineUtils</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><ul class="inheritance"></ul></li><li><ul class="inheritance"></ul></li><li><ul class="inheritance"></ul></li><li>PipelineUtils
</ul>
<div class="description">
    <ul class="blockList">
        <li class="blockList">



          </li>
    </ul>
</div>

<div class="summary">
    <ul class="blockList">
        <li class="blockList">
        <!-- =========== NESTED CLASS SUMMARY =========== -->
        

        <!-- =========== ENUM CONSTANT SUMMARY =========== -->
        
        <!-- =========== FIELD SUMMARY =========== -->
        

        <!-- =========== PROPERTY SUMMARY =========== -->
        

        <!-- =========== ELEMENT SUMMARY =========== -->
        

        

        
        <!-- ========== METHOD SUMMARY =========== -->
        <ul class="blockList">
            
            <li class="blockList"><a name="method_summary"><!--   --></a>
                    <h3>Methods Summary</h3>
                    <ul class="blockList">
                    <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Methods Summary table">
                        <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
                        <tr>
                            <th class="colFirst" scope="col">Type Params</th>
                            <th class="colLast" scope="col">Return Type</th>
                            <th class="colLast" scope="col">Name and description</th>
                        </tr>
                        
                        <tr class="altColor">
                            <td class="colFirst"><code></code></td>
                            <td class="colLast"><code>java.lang.Object</code></td>
                            <td class="colLast"><code><strong><a href="#checkImageLastModifiedTime(java.lang.String, java.lang.String)">checkImageLastModifiedTime</a></strong>(java.lang.String stage, java.lang.String imageFilePath = 'images/latest-atomic.qcow2')</code><br>variables
  stage - current stage running
  imageFilePath - path to the file to examine last modified time for. </td>
                        </tr>
                        
                        <tr class="rowColor">
                            <td class="colFirst"><code></code></td>
                            <td class="colLast"><code>java.lang.Object</code></td>
                            <td class="colLast"><code><strong><a href="#checkLastImage(java.lang.String)">checkLastImage</a></strong>(java.lang.String stage)</code><br>Library to check last image</td>
                        </tr>
                        
                        <tr class="altColor">
                            <td class="colFirst"><code></code></td>
                            <td class="colLast"><code>java.lang.Object</code></td>
                            <td class="colLast"><code><strong><a href="#convertProps(java.lang.String, java.lang.String)">convertProps</a></strong>(java.lang.String sourceFile, java.lang.String destinationFile)</code><br>Library to prepend 'env.' to the keys in source file and write them in a format of env.key=value in the destination file.</td>
                        </tr>
                        
                        <tr class="rowColor">
                            <td class="colFirst"><code></code></td>
                            <td class="colLast"><code>java.lang.Object</code></td>
                            <td class="colLast"><code><strong><a href="#injectFedmsgVars()">injectFedmsgVars</a></strong>()</code><br>Library to parse CI_MESSAGE and inject its key/value pairs as env variables.</td>
                        </tr>
                        
                        <tr class="altColor">
                            <td class="colFirst"><code>null</code></td>
                            <td class="colLast"><code>static&nbsp;void</code></td>
                            <td class="colLast"><code><strong><a href="#main(java.lang.String)">main</a></strong>(java.lang.String[] args)</code><br>Implicit main method for Groovy Scripts</td>
                        </tr>
                        
                        <tr class="rowColor">
                            <td class="colFirst"><code></code></td>
                            <td class="colLast"><code>java.lang.Object</code></td>
                            <td class="colLast"><code><strong><a href="#provisionResources(java.lang.String)">provisionResources</a></strong>(java.lang.String stage)</code><br>Library to provision resources used in the stage</td>
                        </tr>
                        
                        <tr class="altColor">
                            <td class="colFirst"><code></code></td>
                            <td class="colLast"><code>java.lang.Object</code></td>
                            <td class="colLast"><code><strong><a href="#rsyncData(java.lang.String)">rsyncData</a></strong>(java.lang.String stage)</code><br>Library to create a text string which is written to the file 'task.env' in the {env.ORIGIN_WORKSPACE} and call
 runTaskAndReturnLogs()</td>
                        </tr>
                        
                        <tr class="rowColor">
                            <td class="colFirst"><code></code></td>
                            <td class="colLast"><code>java.lang.Object</code></td>
                            <td class="colLast"><code><strong><a href="#runTaskAndReturnLogs(java.lang.String, java.lang.String)">runTaskAndReturnLogs</a></strong>(java.lang.String stage, java.lang.String duffyKey)</code><br>Library to execute a task and rsync the logs back to artifacts.ci.centos.org</td>
                        </tr>
                        
                        <tr class="altColor">
                            <td class="colFirst"><code></code></td>
                            <td class="colLast"><code>java.lang.Object</code></td>
                            <td class="colLast"><code><strong><a href="#sendMessage(java.lang.String, java.lang.String)">sendMessage</a></strong>(java.lang.String msgProps, java.lang.String msgContent)</code><br>Library to send message</td>
                        </tr>
                        
                        <tr class="rowColor">
                            <td class="colFirst"><code></code></td>
                            <td class="colLast"><code>java.lang.Object</code></td>
                            <td class="colLast"><code><strong><a href="#setDefaultEnvVars(java.util.Map)">setDefaultEnvVars</a></strong>(java.util.Map envMap = null)</code><br>Library to set default environmental variables. </td>
                        </tr>
                        
                        <tr class="altColor">
                            <td class="colFirst"><code></code></td>
                            <td class="colLast"><code>java.lang.Object</code></td>
                            <td class="colLast"><code><strong><a href="#setMessageFields(java.lang.String)">setMessageFields</a></strong>(java.lang.String messageType)</code><br>Library to set message fields to be published</td>
                        </tr>
                        
                        <tr class="rowColor">
                            <td class="colFirst"><code></code></td>
                            <td class="colLast"><code>java.lang.Object</code></td>
                            <td class="colLast"><code><strong><a href="#setStageEnvVars(java.lang.String)">setStageEnvVars</a></strong>(java.lang.String stage)</code><br>Library to set stage specific environmental variables.</td>
                        </tr>
                        
                        <tr class="altColor">
                            <td class="colFirst"><code></code></td>
                            <td class="colLast"><code>java.lang.Object</code></td>
                            <td class="colLast"><code><strong><a href="#setupStage(java.lang.String, java.lang.String)">setupStage</a></strong>(java.lang.String stage, java.lang.String sshKey)</code><br>Library to setup and configure the host the way ci-pipeline requires</td>
                        </tr>
                        
                        <tr class="rowColor">
                            <td class="colFirst"><code></code></td>
                            <td class="colLast"><code>java.lang.Object</code></td>
                            <td class="colLast"><code><strong><a href="#teardownResources(java.lang.String)">teardownResources</a></strong>(java.lang.String stage)</code><br>Library to teardown resources used in the stage</td>
                        </tr>
                        
                    </table>
                   </ul>
              </li>
            
            <li class="blockList"><a name="method_summary"><!--   --></a>
                    <h3>Inherited Methods Summary</h3>
                    <ul class="blockList">
                    <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Inherited Methods Summary table">
                        <caption><span>Inherited Methods</span><span class="tabEnd">&nbsp;</span></caption>
                        <tr>
                            <th class="colFirst" scope="col">Methods inherited from class</th>
                            <th class="colLast" scope="col">Name</th>
                        </tr>
                        
                        <tr class="altColor">
                            <td class="colFirst"><code>class groovy.lang.Script</code></td>
                            <td class="colLast"><code>groovy.lang.Script#println(), groovy.lang.Script#println(java.lang.Object), groovy.lang.Script#run(), groovy.lang.Script#run(java.io.File, [Ljava.lang.String;), groovy.lang.Script#setProperty(java.lang.String, java.lang.Object), groovy.lang.Script#getProperty(java.lang.String), groovy.lang.Script#print(java.lang.Object), groovy.lang.Script#printf(java.lang.String, [Ljava.lang.Object;), groovy.lang.Script#printf(java.lang.String, java.lang.Object), groovy.lang.Script#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.Script#getBinding(), groovy.lang.Script#evaluate(java.lang.String), groovy.lang.Script#evaluate(java.io.File), groovy.lang.Script#setBinding(groovy.lang.Binding), groovy.lang.Script#getMetaClass(), groovy.lang.Script#setMetaClass(groovy.lang.MetaClass), groovy.lang.Script#wait(long, int), groovy.lang.Script#wait(long), groovy.lang.Script#wait(), groovy.lang.Script#equals(java.lang.Object), groovy.lang.Script#toString(), groovy.lang.Script#hashCode(), groovy.lang.Script#getClass(), groovy.lang.Script#notify(), groovy.lang.Script#notifyAll()</code></td>
                        </tr>
                        <tr class="altColor">
                            <td class="colFirst"><code>class groovy.lang.GroovyObjectSupport</code></td>
                            <td class="colLast"><code>groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll()</code></td>
                        </tr>
                    </table>
                   </ul>
              </li>
                
        </ul>
        
    </li>
    </ul>
</div>

<div class="details">
    <ul class="blockList">
        <li class="blockList">
           

            

            

            

            


            
            <!-- =========== METHOD DETAIL =========== -->
            <ul class="blockList">
                <li class="blockList"><a name="method_detail">
                    <!--   -->
                </a>
                    <h3>Method Detail</h3>
                    
                        <a name="checkImageLastModifiedTime(java.lang.String, java.lang.String)"><!-- --></a>
                        <ul class="blockListLast">
                            <li class="blockList">
                                <h4>java.lang.Object <strong>checkImageLastModifiedTime</strong>(java.lang.String stage, java.lang.String imageFilePath = 'images/latest-atomic.qcow2')</h4>
                                <p>

 variables
  stage - current stage running
  imageFilePath - path to the file to examine last modified time for. Defaults to 'images/latest-atomic.qcow2'
 </p>
                            </li>
                        </ul>
                    
                        <a name="checkLastImage(java.lang.String)"><!-- --></a>
                        <ul class="blockListLast">
                            <li class="blockList">
                                <h4>java.lang.Object <strong>checkLastImage</strong>(java.lang.String stage)</h4>
                                <p> Library to check last image <DL><DT><B>Returns:</B></DT><DD></DD></DL><DL><DT><B>Parameters:</B></DT><DD>stage</DD></DL></p>
                            </li>
                        </ul>
                    
                        <a name="convertProps(java.lang.String, java.lang.String)"><!-- --></a>
                        <ul class="blockListLast">
                            <li class="blockList">
                                <h4>java.lang.Object <strong>convertProps</strong>(java.lang.String sourceFile, java.lang.String destinationFile)</h4>
                                <p> Library to prepend 'env.' to the keys in source file and write them in a format of env.key=value in the destination file. <DL><DT><B>Returns:</B></DT><DD></DD></DL><DL><DT><B>Parameters:</B></DT><DD><code>sourceFile</code> -  - The file to read from</DD><DD><code>destinationFile</code> -  - The file to write to</DD></DL></p>
                            </li>
                        </ul>
                    
                        <a name="injectFedmsgVars()"><!-- --></a>
                        <ul class="blockListLast">
                            <li class="blockList">
                                <h4>java.lang.Object <strong>injectFedmsgVars</strong>()</h4>
                                <p> Library to parse CI_MESSAGE and inject its key/value pairs as env variables.

 </p>
                            </li>
                        </ul>
                    
                        <a name="main(java.lang.String)"><!-- --></a>
                        <ul class="blockListLast">
                            <li class="blockList">
                                <h4>static&nbsp;void <strong>main</strong>(java.lang.String[] args)</h4>
                                <p>Implicit main method for Groovy Scripts</p>
                            </li>
                        </ul>
                    
                        <a name="provisionResources(java.lang.String)"><!-- --></a>
                        <ul class="blockListLast">
                            <li class="blockList">
                                <h4>java.lang.Object <strong>provisionResources</strong>(java.lang.String stage)</h4>
                                <p> Library to provision resources used in the stage <DL><DT><B>Returns:</B></DT><DD></DD></DL><DL><DT><B>Parameters:</B></DT><DD><code>stage</code> -  - Current stage</DD></DL></p>
                            </li>
                        </ul>
                    
                        <a name="rsyncData(java.lang.String)"><!-- --></a>
                        <ul class="blockListLast">
                            <li class="blockList">
                                <h4>java.lang.Object <strong>rsyncData</strong>(java.lang.String stage)</h4>
                                <p> Library to create a text string which is written to the file 'task.env' in the {env.ORIGIN_WORKSPACE} and call
 runTaskAndReturnLogs() <DL><DT><B>Returns:</B></DT><DD></DD></DL><DL><DT><B>Parameters:</B></DT><DD><code>stage</code> -  - Current stage</DD></DL></p>
                            </li>
                        </ul>
                    
                        <a name="runTaskAndReturnLogs(java.lang.String, java.lang.String)"><!-- --></a>
                        <ul class="blockListLast">
                            <li class="blockList">
                                <h4>java.lang.Object <strong>runTaskAndReturnLogs</strong>(java.lang.String stage, java.lang.String duffyKey)</h4>
                                <p> Library to execute a task and rsync the logs back to artifacts.ci.centos.org <DL><DT><B>Returns:</B></DT><DD></DD></DL><DL><DT><B>Parameters:</B></DT><DD>stage</DD><DD>duffyKey</DD></DL></p>
                            </li>
                        </ul>
                    
                        <a name="sendMessage(java.lang.String, java.lang.String)"><!-- --></a>
                        <ul class="blockListLast">
                            <li class="blockList">
                                <h4>java.lang.Object <strong>sendMessage</strong>(java.lang.String msgProps, java.lang.String msgContent)</h4>
                                <p> Library to send message <DL><DT><B>Returns:</B></DT><DD></DD></DL><DL><DT><B>Parameters:</B></DT><DD><code>msgProps</code> -  - The message properties in key=value form, one key/value per line ending in '\\n'</DD><DD><code>msgContent</code> -  - Message content.</DD></DL></p>
                            </li>
                        </ul>
                    
                        <a name="setDefaultEnvVars(java.util.Map)"><!-- --></a>
                        <ul class="blockListLast">
                            <li class="blockList">
                                <h4>java.lang.Object <strong>setDefaultEnvVars</strong>(java.util.Map envMap = null)</h4>
                                <p> Library to set default environmental variables. Performed once at start of Jenkinsfile <DL><DT><B>Returns:</B></DT><DD></DD></DL><DL><DT><B>Parameters:</B></DT><DD><code>envMap:</code> -  Key/value pairs which will be set as environmental variables.</DD></DL></p>
                            </li>
                        </ul>
                    
                        <a name="setMessageFields(java.lang.String)"><!-- --></a>
                        <ul class="blockListLast">
                            <li class="blockList">
                                <h4>java.lang.Object <strong>setMessageFields</strong>(java.lang.String messageType)</h4>
                                <p> Library to set message fields to be published <DL><DT><B>Returns:</B></DT><DD></DD></DL><DL><DT><B>Parameters:</B></DT><DD><code>messageType:</code> -  \${MAIN_TOPIC}.ci.pipeline.<defined-in-README></DD></DL></p>
                            </li>
                        </ul>
                    
                        <a name="setStageEnvVars(java.lang.String)"><!-- --></a>
                        <ul class="blockListLast">
                            <li class="blockList">
                                <h4>java.lang.Object <strong>setStageEnvVars</strong>(java.lang.String stage)</h4>
                                <p> Library to set stage specific environmental variables. <DL><DT><B>Returns:</B></DT><DD></DD></DL><DL><DT><B>Parameters:</B></DT><DD><code>stage</code> -  - Current stage</DD></DL></p>
                            </li>
                        </ul>
                    
                        <a name="setupStage(java.lang.String, java.lang.String)"><!-- --></a>
                        <ul class="blockListLast">
                            <li class="blockList">
                                <h4>java.lang.Object <strong>setupStage</strong>(java.lang.String stage, java.lang.String sshKey)</h4>
                                <p> Library to setup and configure the host the way ci-pipeline requires <DL><DT><B>Returns:</B></DT><DD></DD></DL><DL><DT><B>Parameters:</B></DT><DD>stage</DD><DD>sshKey</DD></DL></p>
                            </li>
                        </ul>
                    
                        <a name="teardownResources(java.lang.String)"><!-- --></a>
                        <ul class="blockListLast">
                            <li class="blockList">
                                <h4>java.lang.Object <strong>teardownResources</strong>(java.lang.String stage)</h4>
                                <p> Library to teardown resources used in the stage <DL><DT><B>Returns:</B></DT><DD></DD></DL><DL><DT><B>Parameters:</B></DT><DD><code>stage</code> -  - Current stage</DD></DL></p>
                            </li>
                        </ul>
                    
                </li>
            </ul>
            
        </li>
    </ul>
</div>

<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
    <!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
    <!--   -->
</a>
    <ul class="navList" title="Navigation">
        <li><a href="../overview-summary.html">Overview</a></li>
        <li><a href="package-summary.html">Package</a></li>
        <li class="navBarCell1Rev">Class</li>
        <li><a href="../deprecated-list.html">Deprecated</a></li>
        <li><a href="../index-all.html">Index</a></li>
        <li><a href="../help-doc.html">Help</a></li>
    </ul>
</div>

<div class="subNav">
    <div>
        <ul class="navList">
            <li><a href="../index.html?DefaultPackage/PipelineUtils" target="_top">Frames</a></li>
            <li><a href="PipelineUtils.html" target="_top">No Frames</a></li>
        </ul>
    </div>
    <div>
        <ul class="subNavList">
            <li>Summary:&nbsp;</li>
            Nested&nbsp;&nbsp;&nbsp;Field&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="#method_summary">Method</a></li>&nbsp;&nbsp;&nbsp;
        </ul>
        <ul class="subNavList">
            <li>&nbsp;|&nbsp;Detail:&nbsp;</li>
            Field&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li><a href="#method_detail">Method</a></li>&nbsp;&nbsp;&nbsp;
        </ul>
    </div>
    
    <a name="skip-navbar_bottom">
        <!--   -->
    </a>
    </div>
</div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
